package com.inno.subject.common.enums;

import lombok.Getter;

/**
 * 是否状态枚举 0-是 1-否
 */
@Getter
public enum YesOrNoEnum {
    YES("0", "是","yes"),
    NO("1", "否","no");

    private final String code;
    private final String desc;
    private final String value;

    YesOrNoEnum(String code, String desc,String value) {
        this.code = code;
        this.desc = desc;
        this.value = value;
    }

    public static YesOrNoEnum getEnumByCode(String code) {
        for (YesOrNoEnum e : YesOrNoEnum.values()) {
            if (e.getCode().equals(code)) {
                return e;
            }
        }
        return null;
    }
}
